<@pp.dropOutputFile/>

<#-- generate package name -->

<#-- iterate table list-->
<@pp.changeOutputFile name="/main/webapp/common/json.ftl"/>
<#noparse>
<#if fieldErrors?exists && (fieldErrors?size > 0)>
{
	"success":-1,
	"message":"<#assign keys = fieldErrors?keys><#list keys as key>${key}:<#list fieldErrors[key] as item>${item}</#list><#if key_has_next>,</#if></#list>"
	,"total":0,                                                      
	"rows": []
}
<#else>
	<#if output?exists && output.data?exists>
{
	"success":<#if output.res?exists>${output.res}<#else>-1</#if>,
	"message":"<#if output.message?exists>${output.message}<#else></#if>",
	"detail":"<#if output.detail?exists>${output.detail}<#else></#if>",
	"total":<#if output.total?exists>${output.total}<#else>-1</#if>,                                                      
	"rows": ${output.data}
}
	<#else>
{
	"success":-1,
	"message":"操作失败",
	"total":0,                                                      
	"rows": []
}
	</#if>
</#if>
</#noparse>


